home *** CD-ROM | disk | FTP | other *** search
- // MatrixPaletteSkinning shader file.
- // This shader performs a simple matrix palette skinning implementation
- //
-
- // For non-textured objects
- NSFShader MatrixPaletteSkinning
- {
- "A simple skinning example.
- Supports 20 bones per
- partition."
-
- // Attribute list
- Attributes
- {
- Attrib_Color
- SelectedColor
- Artist
- 1.0,1.0,1.0,1.0
- [(0.0,0.0,0.0,0.0) (1.0,1.0,1.0,1.0)]
- }
-
- // Packing Definition
- PackingDef PosBlendWeightBlendIndicesNormUV0
- {
- PD_Stream 0
- PDP_Position 0 PDT_Float3
- PDP_BlendWeights 1 PDT_Float3
- PDP_BlendIndices 2 PDT_UByteColor
- PDP_Normal 3 PDT_Float3
- PDP_TexCoord0 7 PDT_Float2
- }
-
- // Implementation
- Implementation VS11
- {
- "This implementation is intended for hardware
- that supports vertex shader version 1.1"
-
- // Requirements for this implementation
- Requirements
- {
- Platform = DX8|DX9|XBOX|XENON
- VSVersion = v1.1
- UserVersion = v0.0
- PSVersion = v0.0
- BinormalTangentMethod = NBTMethod_None
- BonesPerPartition = 20
- UsesNiRenderState = true
- }
-
- // Packing Definition it uses
- PackingDef PosBlendWeightBlendIndicesNormUV0
-
- // 'Global' render states
- RenderStates
- {
- AlphaBlendEnable = false
- SrcBlend = SrcAlpha
- DestBlend = InvSrcAlpha
- Lighting = false;
- }
-
- // First pass
- Pass Pass0
- {
- // Vertex shader program
- VSProgram "MatrixPaletteSkinning"
-
- // Vertex Shader constant map
- VS_Constantmap
- {
- CM_Defined SkinWorldViewProjTranspose 0 0
- CM_Defined MaterialDiffuse 4 0
- CM_Constant const_1_1_1_255 5 1 1.0,1.0,1.0,765.01
- CM_Defined BoneMatrix3 10 0 20
- }
-
- // Texture stage 0
- Stage 0 Stage0
- {
- TSS_ColorOp = TOP_SelectArg2
- TSS_ColorArg1 = TA_Texture
- TSS_ColorArg2 = TA_Diffuse
- TSS_AlphaOp = TOP_Disable
- TSS_Texture = NTM_Base
- }
-
- // Sampler stage 0
- Sampler 0 Sampler0
- {
- TSAMP_AddressU = TADDR_Wrap
- TSAMP_AddressV = TADDR_Wrap
- TSAMP_AddressW = TADDR_Wrap
- TSAMP_MagFilter = TEXF_Linear
- TSAMP_MinFilter = TEXF_Linear
- TSAMP_MipFilter = TEXF_None
- }
- }
- }
- }
-
- // For textured objects
- NSFShader MatrixPaletteSkinning_Textured
- {
- "A simple skinning example.
- Supports 20 bones per
- partition. Applies the
- base map."
-
- // Packing Definition
- PackingDef PosBlendWeightBlendIndicesNormUV0
- {
- PD_Stream 0
- PDP_Position 0 PDT_Float3
- PDP_BlendWeights 1 PDT_Float3
- PDP_BlendIndices 2 PDT_UByteColor
- PDP_Normal 3 PDT_Float3
- PDP_TexCoord0 7 PDT_Float2
- }
-
- // Implementation
- Implementation VS11
- {
- "This implementation is intended for hardware
- that supports vertex shader version 1.1"
-
- // Requirements for this implementation
- Requirements
- {
- Platform = DX8|DX9|XBOX|XENON
- VSVersion = v1.1
- UserVersion = v0.0
- PSVersion = v0.0
- BinormalTangentMethod = NBTMethod_None
- BonesPerPartition = 26
- UsesNiRenderState = true
- }
-
- // Packing Definition it uses
- PackingDef PosBlendWeightBlendIndicesNormUV0
-
- // 'Global' render states
- RenderStates
- {
- AlphaBlendEnable = false
- SrcBlend = SrcAlpha
- DestBlend = InvSrcAlpha
- Lighting = false;
- }
-
- // First pass
- Pass Pass0
- {
- // Vertex shader program
- VSProgram "MatrixPaletteSkinning"
-
- // Vertex Shader constant map
- VS_Constantmap
- {
- CM_Defined SkinWorldViewProjTranspose 0 0
- CM_Constant const_1_1_1_255 5 1 1.0,1.0,1.0,765.01
- CM_Defined BoneMatrix3 10 0 26
- }
-
- // Texture stage 0
- Stage 0 Stage0
- {
- TSS_ColorOp = TOP_SelectArg1
- TSS_ColorArg1 = TA_Texture
- TSS_ColorArg2 = TA_Diffuse
- TSS_AlphaOp = TOP_Disable
- TSS_Texture = NTM_Base
- }
-
- // Sampler stage 0
- Sampler 0 Sampler0
- {
- TSAMP_AddressU = TADDR_Wrap
- TSAMP_AddressV = TADDR_Wrap
- TSAMP_AddressW = TADDR_Wrap
- TSAMP_MagFilter = TEXF_Linear
- TSAMP_MinFilter = TEXF_Linear
- TSAMP_MipFilter = TEXF_None
- }
- }
- }
- }
-